<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      >
    <h:head>
        <title>Đổi mật khẩu</title>
        <script>
            function confirmComplete() {
                var answer = confirm("Bạn có chắc chắn muốn xóa bản ghi này?");
                if (answer == true)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        </script>        
    </h:head>
    <h:body> 
        <link type="text/css" rel="stylesheet" href="../css/main.css" />        
        <style type="text/css">
            .ui-widget{font-size:95% !important;}
            .ui-layout-unit-content{background-color: #E5E5E5;border-width: 0px}      
            .ui-widget{border-width: 0px;color: red}
        </style>
        <div align="center" id="bodyForm" >            
            <div style="width: 100%;">
                <p:layoutUnit id="top" position="north" size="auto">
                    <ui:insert name="menu">
                        <ui:include src="../templates/menu.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>

                <p:layoutUnit id="center" position="center" size="400">
                    <h1 class="headerbar">THAY ĐỔI MẬT KHẨU</h1>
                    <h:form id="fmdf">
                        <br></br>
                        <p:growl id="messages"/> 
                        <h:panelGrid id="pngmdf" columns="2">

                            <h:panelGroup>
                                Mật khẩu cũ <h:outputLabel value="(*) " style="color: red"/>:  
                            </h:panelGroup>
                            <p:inputText type="password" id="ipOP" value="#{passwordController.strOldPass}"/>                            

                            <h:panelGroup>
                                Mật khẩu mới<h:outputLabel value="(*) " style="color: red"/>:
                            </h:panelGroup>
                            <p:password id="ipNP" value="#{passwordController.strNewPass}"/>

                            <h:panelGroup> 
                                Xác nhận mật khẩu <h:outputLabel value="(*) " style="color: red"/>:
                            </h:panelGroup>
                            <p:inputText type="password" id="ipRNP" value="#{passwordController.strRNewPass}"/>
                            
                            <h:outputText value=""/>                            
                            <h:panelGrid columns="2">
                                <p:commandButton  update="fmdf" action="#{passwordController.onUpdate()}" value="Thay đổi">
                                    <f:param name="strUserLogin" value="#{loginBean.strUserName}"/>
                                    <f:param name="strPassLogin" value="#{loginBean.strPassword}"/>
                                </p:commandButton>
                                <p:commandButton action="#{passwordController.onReset()}"  update="pngmdf" value="Nhập lại" id="l"/>
                            </h:panelGrid>
                        </h:panelGrid>                            
                    </h:form>
                </p:layoutUnit>
                <p:layoutUnit id="bottom" position="bottom" size="60">
                    <ui:insert name="footer">
                        <ui:include src="../templates/footer.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>
            </div>
        </div>
    </h:body>
</html>

